<?php

/**
 * Comment form base class.
 *
 * @package    blogallery
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 12815 2008-11-09 10:43:58Z fabien $
 */
class BaseCommentForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'       => new sfWidgetFormInputHidden(),
      'post_id'  => new sfWidgetFormPropelChoice(array('model' => 'Post', 'add_empty' => false)),
      'ip'       => new sfWidgetFormInput(),
      'name'     => new sfWidgetFormInput(),
      'email'    => new sfWidgetFormInput(),
      'url'      => new sfWidgetFormInput(),
      'content'  => new sfWidgetFormTextarea(),
      'datetime' => new sfWidgetFormDateTime(),
      'approved' => new sfWidgetFormInput(),
      'user_id'  => new sfWidgetFormPropelChoice(array('model' => 'User', 'add_empty' => true)),
    ));

    $this->setValidators(array(
      'id'       => new sfValidatorPropelChoice(array('model' => 'Comment', 'column' => 'id', 'required' => false)),
      'post_id'  => new sfValidatorPropelChoice(array('model' => 'Post', 'column' => 'id')),
      'ip'       => new sfValidatorString(array('max_length' => 15)),
      'name'     => new sfValidatorString(array('max_length' => 50)),
      'email'    => new sfValidatorString(array('max_length' => 100)),
      'url'      => new sfValidatorString(array('max_length' => 100)),
      'content'  => new sfValidatorString(),
      'datetime' => new sfValidatorDateTime(array('required' => false)),
      'approved' => new sfValidatorInteger(),
      'user_id'  => new sfValidatorPropelChoice(array('model' => 'User', 'column' => 'id', 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('comment[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Comment';
  }


}
